package com.leen.user.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @author 
 * 用户表
 */
@Table(name="yx_user")
@Data
@Entity
@ApiModel(value = "用户表")
public class YxUser implements Serializable {
    /**
     * 用户id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "uid")
    @ApiModelProperty(value = "用户id")
    private Long uid;

    /**
     * 用户账户(跟accout一样)
     */
    @Column(name = "username")
    @ApiModelProperty(value = "用户账户(跟accout一样)")
    private String username;

    /**
     * 用户密码（跟pwd）
     */
    @Column(name = "password")
    @ApiModelProperty(value = "用户密码（跟pwd）")
    private String password;

    /**
     * 真实姓名
     */
    @Column(name = "real_name")
    @ApiModelProperty(value = "真实姓名")
    private String realName;

    /**
     * 生日
     */
    @Column(name = "birthday")
    @ApiModelProperty(value = "生日",example = "0")
    private Integer birthday;

    /**
     * 身份证号码
     */
    @Column(name = "card_id")
    @ApiModelProperty(value = "身份证号码")
    private String cardId;

    /**
     * 用户备注
     */
    @Column(name = "mark")
    @ApiModelProperty(value = "用户备注")
    private String mark;

    /**
     * 用户昵称
     */
    @Column(name = "nickname")
    @ApiModelProperty(value = "用户昵称")
    private String nickname;

    /**
     * 用户头像
     */
    @Column(name = "avatar")
    @ApiModelProperty(value = "用户头像")
    private String avatar;

    /**
     * 手机号码
     */
    @Column(name = "phone")
    @ApiModelProperty(value = "手机号码")
    private String phone;

    /**
     * 添加ip
     */
    @Column(name = "add_ip")
    @ApiModelProperty(value = "添加ip")
    private String addIp;

    /**
     * 添加时间
     */
    @Column(name = "create_time")
    @ApiModelProperty(value = "添加时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 最后一次登录时间
     */
    @Column(name = "update_time")
    @ApiModelProperty(value = "最后一次登录时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 最后一次登录ip
     */
    @Column(name = "last_ip")
    @ApiModelProperty(value = "最后一次登录ip")
    private String lastIp;

    /**
     * 用户余额
     */
    @Column(name = "now_money")
    @ApiModelProperty(value = "用户余额")
    private BigDecimal nowMoney;

    /**
     * 佣金金额
     */
    @Column(name = "brokerage_price")
    @ApiModelProperty(value = "佣金金额")
    private BigDecimal brokeragePrice;

    /**
     * 用户剩余积分
     */
    @Column(name = "integral")
    @ApiModelProperty(value = "用户剩余积分")
    private BigDecimal integral;

    /**
     * 连续签到天数
     */
    @Column(name = "sign_num")
    @ApiModelProperty(value = "连续签到天数")
    private Integer signNum;

    /**
     * 1为正常，0为禁止
     */
    @Column(name = "status")
    @ApiModelProperty(value = "1为正常，0为禁止")
    private Byte status;

    /**
     * 等级
     */
    @Column(name = "level")
    @ApiModelProperty(value = "等级")
    private Byte level;

    /**
     * 推广元id
     */
    @Column(name = "spread_uid")
    @ApiModelProperty(value = "推广元id")
    private Long spreadUid;

    /**
     * 推广员关联时间
     */
    @Column(name = "spread_time")
    @ApiModelProperty(value = "推广员关联时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date spreadTime;

    /**
     * 用户类型
     */
    @Column(name = "user_type")
    @ApiModelProperty(value = "用户类型")
    private String userType;

    /**
     * 是否为推广员
     */
    @Column(name = "is_promoter")
    @ApiModelProperty(value = "是否为推广员")
    private Byte promoter;

    /**
     * 用户购买次数
     */
    @Column(name = "pay_count")
    @ApiModelProperty(value = "用户购买次数",example = "0")
    private Integer payCount;

    /**
     * 下级人数
     */
    @Column(name = "spread_count")
    @ApiModelProperty(value = "下级人数",example = "0")
    private Integer spreadCount;

    /**
     * 详细地址
     */
    @Column(name = "addres")
    @ApiModelProperty(value = "详细地址")
    private String addres;

    /**
     * 管理员编号 
     */
    @Column(name = "adminid")
    @ApiModelProperty(value = "管理员编号",example = "0")
    private Integer adminid;

    /**
     * 用户登陆类型，h5,wechat,routine
     */
    @Column(name = "login_type")
    @ApiModelProperty(value = "用户登陆类型，h5,wechat,routine")
    private String loginType;

    /**
     * 微信用户json信息
     */
    @Column(name = "wx_profile")
    @ApiModelProperty(value = "微信用户json信息")
    private String wxProfile;

    @Column(name = "is_del")
    @ApiModelProperty(value = "手机号码")
    private Byte del;


}